<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">
<title>MG后台管理系统登录页</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" href="css/supersized.css">
<link rel="stylesheet" href="css/login.css">
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/loginjs/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="js/loginjs/jquery.form.js"></script>
<script type="text/javascript" src="js/loginjs/tooltips.js"></script>
<!-- <script src="js/gVerify.js"></script> -->
<style type="text/css">
/* #verifyCanvas{
	width: 150px;
    height: 34px;
    border-bottom-right-radius: 4px;
    border-top-right-radius: 4px;
} */
</style>
</head>
<body>

<div class="page-container">
	<div class="main_box">
		<div class="login_box">
			<div class="login_logo">
				<h1>MG后台管理系统</h1>
			</div>
		
			<div class="login_form">
				<form action="" id="login_form" method="post">
					<br>
					<div class="form-group">
						<label for="j_username" class="t">用户名：</label> 
						<input id="email" value="" name="email" type="text" class="form-control x319 in" autocomplete="off" placeholder="用户名">
					</div>
					<br>
					<div class="form-group" style="margin-bottom: 40px;">
						<label for="j_password" class="t">密　码：</label> 
						<input id="password" value="" name="password" type="password" class="password form-control x319 in" placeholder="密码">
					</div>
<!-- 					<div class="form-group" style="display: -webkit-inline-box;margin-bottom: 0px !important;">
						<label for="j_captcha" class="t">验证码：</label>
						<input type="text" id="code_input" value="" class="form-control in" placeholder="验证码" 
						style="width: 170px;border-bottom-right-radius: 0px !important;;border-top-right-radius: 0px; !important;"/>
						<p id="v_container"></p>
					</div> -->
<!-- 					<div class="form-group">
						<label class="t"></label>
						<label for="j_remember" class="m">
						<input id="j_remember" type="checkbox" value="true">&nbsp;记住登陆账号!</label>
					</div> -->
					<br>
					<br>
					<div class="form-group space">
						<label class="t"></label>　　　
						<button type="button"  id="submit_btn" class="btn btn-primary btn-lg">&nbsp;登&nbsp;录&nbsp </button>
						<input type="reset" value="&nbsp;重&nbsp;置&nbsp;" class="btn btn-default btn-lg">
					</div>
				</form>
			</div>
		</div>
		<div class="bottom">Copyright &copy; 2017 - 2018</div>
	</div>
</div>

<!-- Javascript -->

<script src="js/loginjs/supersized.3.2.7.min.js"></script>
<script src="js/loginjs/supersized-init.js"></script>
<script src="js/loginjs/scripts.js"></script>
<div style="text-align:center;">
</div>
<script type="text/javascript">

var basePath = "<%=basePath%>";
document.onkeydown = function(e){
	if($(".bac").length==0){
		if(!e) e = window.event;
		if((e.keyCode || e.which) == 13){
			var obtnLogin=document.getElementById("submit_btn")
			obtnLogin.focus();
		}
	}
}

function login() {
	var name=$("#email").val();
	var password=$("#password").val();
}
	
$(function(){
	/* var verifyCode = new GVerify("v_container"); */

	$('#submit_btn').click(function(){
		show_loading();
		if($('#email').val() == ''){
			show_err_msg('用戶名还没填呢！');	
			$('#email').focus();
		}else if($('#password').val() == ''){
			show_err_msg('密码还没填呢！');
			$('#password').focus();
		}else{
			var name=$("#email").val();
			var password=$("#password").val();
			var res =true;
			/* var res = verifyCode.validate(document.getElementById("code_input").value); */
			if(res){
				$.ajax({
					url : "./sysAdimn/login",
					type: "GET",
					data: {
						adminName: name,
						password : password
					},
					dataType : 'json',
					success: function(ret) {
						if(ret.resultCode==0){
							show_msg('登录成功咯！  正在为您跳转...','/');
							window.location.href = "./jsp/illness/medicalrecordList.jsp";
						}else{
							show_msg("登录失败，请联系管理员");
							window.location.reload();
						}
					},
				});
			}else{
				show_err_msg("验证码错误，请重新输入");
				verifyCode.refresh();
				$("#code_input").val("");
			}
		}
	});
});
</script>
</body>
</html>
